//委托单位联系人管理 处理窗体
Ext.define("SHApp.CompanyManage.AgentLinkman.Form", {
    extend: "BLBTSystem.Form",
    requires: ['SHApp.CompanyManage.AgentLinkman.AgentComboBox'],
    submitUrl: "api/agentlinkman?format=json",
    winWidth: 665,
    winHeight: 215,
    txtAgentId: "_txtAgentId",
    initComponent: function () {
        Ext.apply(this);
        this.txtAgentId += this.id;
        this.createItems();
        this.callParent(arguments);
    },
    createItems: function () {
        var me = this;
        this.items = [{
            width: 300,
            border: false,
            bodyStyle: "background:#DFE9F6",
            layout: { type: "vbox", align: "stretch" },
            items: [{
                xtype: "textfield",
                fieldLabel: "ID",
                name: "Id",
                hidden: true
            }, {
                fieldLabel: "<span style='color:red'>*</span>委托单位Id",
                allowBlank: false,
                blankText: "请输入委托单位Id!",
                xtype: "textfield",
                name: "AgentId",
                maxLength: 50,
                hidden: true,
                id: this.txtAgentId
            }, {
                fieldLabel: "<span style='color:red'>*</span>委托单位",
                allowBlank: false,
                blankText: "请选择委托单位!",
                xtype: "agentComboBox",
                valueField: "ChineseFullName",
                displayField: "ChineseFullName",
                name: "AgentName",
                maxLength: 50,
                listeners: {
                    select: function (cmb, rs, opts) {
                        if (rs != null && rs.length > 0) {
                            me.down("#" + me.txtAgentId).setValue(rs[0].data.Id);
                        }
                    }
                }
            }, {
                fieldLabel: "<span style='color:red'>*</span>联系人姓名",
                allowBlank: false,
                blankText: "请输入联系人姓名!",
                xtype: "textfield",
                name: "LinkmanName",
                maxLength: 50
            }, {
                fieldLabel: "<span style='color:red'>*</span>办公电话",
                allowBlank: false,
                blankText: "请输入办公电话!",
                xtype: "textfield",
                name: "OfficialTel",
                maxLength: 50
            }, {
                fieldLabel: "办公移动电话",
                xtype: "textfield",
                name: "OfficialMobile",
                maxLength: 50
            }]
        }, {
            width: 300,
            border: false,
            bodyStyle: "background:#DFE9F6",
            layout: { type: "vbox", align: "stretch" },
            items: [ {
                fieldLabel: "<span style='color:red'>*</span>联系邮箱",
                allowBlank: false,
                blankText: "请输入联系邮箱!",
                xtype: "textfield",
                name: "Email",
                maxLength: 50
            }, {
                fieldLabel: "职务",
                xtype: "textfield",
                name: "Position",
                maxLength: 50
            }, {
                fieldLabel: "所在部门",
                xtype: "textfield",
                name: "Department",
                maxLength: 50
            }, {
                fieldLabel: "备注",
                xtype: "textfield",
                name: "Remark",
                maxLength: 150
            }]
        }
		];
    }

})